<extend name="Common@Layout:layui" />
<block name="title">
    <title>Banner管理</title>
</block>
<block name="style">
    <style>
        .pd-20 {
            padding: 20px;
        }
    </style>
</block>

<block name="main">
    <div class="pd-20">
        <div>
            <a style="text-decoration:none" class="layui-btn" onclick="open_iframe_dialog('{:U('edit')}','添加Banner',['80%','80%'],1)" href="javascript:;" title="添加">添加banner</a>
        </div>
        <div class="layui-form datashow" data-url="{:U('getdata')}" data-to-red="" data-condition="" data-p="" data-row="10">
            <form class="mini-form">
                <table class="layui-table">
                    <thead>
                        <tr class="text-c">
                            <th width="40">ID</th>
                            <th width="">标题</th>
                            <th width="">key</th>
                            <th width="80">状态</th>
                            <th width="230">操作</th>
                        </tr>
                    </thead>
                    <tbody class="data"></tbody>
                </table>
                <div class="page" style="text-align:center;margin:20px 0;"></div>
                <script class="data-tpl" type="text/html">
                    {{# layui.each(d, function(index, item){ }}
                    <tr>
                        <td>{{item.id}}</td>
                        <td>{{item.title}}</td>
                        <td>{{item.key}}</td>
                        <td>
                            {{# if(item.status === '0') { }}
                            <span style="color:red">禁用</span> {{# } }} {{# if(item.status === '1'){ }}
                            <span style="color:green">启用</span> {{# } }}
                        </td>
                        <td>
                            <a style="text-decoration:none" class="layui-btn layui-btn-small" onclick="open_iframe_dialog('/plugin/banner/img_list?pid={{item.id}}','管理图片',['100%','100%'],0)" href="javascript:;" title="">管理图片</a>
                            <a style="text-decoration:none" class="layui-btn layui-btn-small layui-btn-normal" onclick="open_iframe_dialog('/plugin/banner/edit?id={{item.id}}','编辑Banner',['80%','80%'],1)" href="javascript:;" title="编辑Banner">编辑banner</a>
                            <a style="text-decoration:none" class="layui-btn layui-btn-small layui-btn-danger mini_del" data-url="/plugin/banner/del?id={{item.id}}" href="javascript:;" title="删除">删除</a> </td>
                    </tr>
                    {{# }); }} {{# if(d.length === 0){ }} --- No Data --- {{# } }}
                </script>
            </form>
        </div>
    </div>
</block>

<block name="script">

</block>